import Vue from 'vue';
import VueRouter from 'vue-router';
import Login from '@/pages/login';
import Home from '@/pages/home';
import Homepage from '@/pages/homepage';
import Qa from '@/pages/qa';
import Video from '@/pages/video';
import My from '@/pages/my';
import Search from '@/pages/search';
import SearchResult from '@/pages/search-result';
import ArticleDetail from '@/pages/article-detail';


Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    component: Home,
    children: [
      {
        path: '',
        component: Homepage,
      },
      {
        path: 'qa',
        component: Qa,
      },
      {
        path: 'video',
        component: Video,
      },
      {
        path: 'my',
        component: My,
      },
    ],
  },
  {
    path: '/login',
    component: Login,
  },
  {
    path: '/search',
    component: Search,
  },
  {
    path: '/search-result',
    name: 'search-result',
    component: SearchResult,
  },
  {
    path: '/article-detail',
    name: 'article-detail',
    component: ArticleDetail,
  },
];

export default new VueRouter({ routes });
